package com.i2works.smartluolong.utils.base;

import java.util.Objects;

/**
 * 工作流-事项类型标识
 *
 * @author Liu Yutao <koal@vip.qq.com>
 * @date 2018/3/23 15:02
 */

public enum MatterNatureEnum {
	ITEM_PUBLICITY(1, "公示"),
	ITEM_DECLARE(2, "申报");

    MatterNatureEnum(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    private Integer key;
    private String value;

    public Integer getKey() {
        return key;
    }

    public void setKey(Integer key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    // 根据value返回枚举类型,主要在switch中使用
    public static MatterNatureEnum getByValue(String value) {
        for (MatterNatureEnum flowItemTypeEnum : values()) {
            if (Objects.equals(flowItemTypeEnum.getKey(), value)) {
                return flowItemTypeEnum;
            }
        }
        return null;
    }

}
